home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / dbms_mag / 9101 / desq2.jan < prev    next >
Text File  |  1990-11-09  |  2KB  |  80 lines

  1.  
  2. Listing 2:
  3.  
  4.  
  5. * Get the handle of the parent process
  6.      WinMain = WIN_Me()
  7.      KeyMain = KEY_Me()
  8.  
  9. * Assign mouse handle to memvar
  10.      PtrMain = PTR_New()
  11. * Attach mouse object to main process window
  12.      PTR_Open(PtrMain, WinMain )
  13.  
  14. * Assign a window to a subtask (5 rows deep and 20 columns  wide) 
  15.      WinSub = WIN_New("Subtask Window Title", 5, 20)
  16. * Associate a keyboard object with the subtask window:
  17. * First get the keyboard object's handle
  18.      KeySub = KEY_New()
  19. * Now attach it to the subtask:
  20.      KEY_Open( KeySub, WinSub )
  21. * Maybe you'll want to receive mail? Open a mailbox:
  22.      MalSub = MAL_New()
  23.  
  24. * Locate the window at a specified row, column
  25.      WIN_Move( WinSub, 19, 40)
  26. * Use this Clipper API extension instead of several numeric attributes
  27.      WIN_SetColor(WinSub, "BG+/B,R+/W,,,n/W")
  28.      WIN_AtSay( WinHan, 0,0, "Check out the subtask window")
  29.      WIN_AtSay( WinSub, 2, 15, "This is the subtask window")
  30.      WIN_AtSay( WinSub, 3, 15, "Press a key to continue. . .      .")
  31. * Be sure that this window appears on top of any others
  32.      WIN_Top( WinSub )
  33. *Force DV to display the window with all above characteristics
  34.      WIN_Redraw( WinSub )
  35.  
  36. * Not INKEY() but an incredible well-behaved imitation:
  37.      KeyPress =  KEY_Inkey( KeySub, 30 )
  38.  
  39.      WIN_Bottom(WIN_Sub)
  40.      WIN_Redraw(WIN_Sub)
  41.  
  42. * Event Loop
  43.      DO WHILE .NOT. EOF()
  44.  
  45.      * Is anything in any of the objects' queues?
  46.           IF OBQ_SizeOf() > 0
  47.           * What's the handle of the object?
  48.                ObjHan = OBQ_Read()
  49.                DO CASE
  50.                     CASE ObjHan = KeySub
  51.                     *Move subtask window to the top; show key
  52.                       pressed
  53.                               CASE ObjHan = MalSub
  54.                     *Move subtask window to the top;
  55.                     *Display the mail message in window
  56.  
  57.                * Timer has signaled its time has come
  58.                     CASE ObjHan = timerobj
  59.                     * start mainframe download
  60.  
  61.                *User clicked mouse at subtask
  62.                     CASE ObjHan = ptrsub
  63.  
  64.                *User pressed key at main process window
  65.                     CASE ObjHan = KeyMain
  66.  
  67.                *User clicked mouse at subtask window
  68.                     CASE ObjHan = PtrMain
  69.                ENDCASE
  70.           ENDIF
  71.      
  72.      * Relinquish time slice to other processes
  73.           API_Pause()
  74.      ENDDO
  75.  
  76.  
  77.  
  78.  
  79.  
  80.